package cn.doitedu.demo5;

import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;

import java.util.HashMap;

public class AviatorTest {

    public static void main(String[] args) {

        Expression expression = AviatorEvaluator.compile("a>b?a*1000:b*1000");

        HashMap<String, Object> data = new HashMap<>();
        data.put("a", 100);
        data.put("b", 200);

        Object result = expression.execute(data);
        System.out.println(result);


    }
}
